@extends('admin_system/public/layout')
@section('content')
    <div class="col-xs-12">
        <p class="float-left"><strong>当前位置：</strong>广告管理>>添加广告</p>

        {{--返回按钮--}}
        <button type="button" class="btn btn-default float-right back" aria-label="Left Align">
            <span class="glyphicon glyphicon-arrow-left back" aria-hidden="true"></span>
            <span>返回</span>
        </button>
    </div>

    <div class="col-xs-12"></div>

    <div class="content-box col-xs-12 mt20 pb20 pt20">
        <form class="col-xs-4" action="{{asset('/admin_system/ad/add')}}" method="post" enctype="multipart/form-data">

            <input type="hidden" name="ad_id" value="{{$ad->ad_id}}">
            {{ csrf_field() }}
            <div class="form-group">
                <label>广告名称</label>
                <input name="ad_name" class="form-control" value="{{$ad->ad_name}}" required>
            </div>

            <div class="form-group">
                <label>图片排序</label>
                <input class="form-control" name="ad_sort" type="number" value="{{$ad->ad_sort}}" required>
            </div>

            <div class="form-group">
                <label>广告图片</label>
                <p><img id="adImg" src="{{asset($ad->ad_img)}}" class="img-thumbnail" style="max-height:200px;"></p>
                <input id="adFile"
                       name="ad_img"
                       type="file"
                       onchange="show_upload_file('adFile','adImg')"
                       accept="image/jpg;image/png;image/gif"
                       @if(!$ad->ad_id)
                           required
                       @endif
                    >
                <p class="help-block">图片大小请保持x:x比例，小于1M</p>
            </div>
            <button type="submit" class="btn btn-primary">提交</button>
        </form>
    </div>


@endsection
